﻿namespace AddressBook.Business.Person
{
	#region "Using Statements"
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	using Csla;
	using Csla.Data;
	#endregion

	public class StateProvinceInfo : ReadOnlyBase<StateProvinceInfo>
	{
		#region "Business Methods"

		#region "Private Member Variables"

		private static PropertyInfo<Int32> IdProperty = RegisterProperty<Int32>(sp => sp.Id);
		private static PropertyInfo<String> StateProvinceCodeProperty = RegisterProperty<String>(sp => sp.StateProvinceCode);
		private static PropertyInfo<String> CountryRegionCodeProperty = RegisterProperty<String>(sp => sp.CountryRegionCode);
		private static PropertyInfo<String> NameProperty = RegisterProperty<String>(sp => sp.Name);
		private static PropertyInfo<Boolean> IsOnlyStateProvinceProperty = RegisterProperty<Boolean>(sp => sp.IsOnlyStateProvince);

		#endregion

		#region "Public Properties"

		public Int32 Id
		{
			get { return GetProperty(IdProperty); }
			private set { LoadProperty(IdProperty, value); }
		}

		public String StateProvinceCode
		{
			get { return GetProperty(StateProvinceCodeProperty); }
			private set { LoadProperty(StateProvinceCodeProperty, value); }
		}

		public String CountryRegionCode
		{
			get { return GetProperty(CountryRegionCodeProperty); }
			private set { LoadProperty(CountryRegionCodeProperty, value); }
		}

		public String Name
		{
			get { return GetProperty(NameProperty); }
			private set { LoadProperty(NameProperty, value); }
		}

		public Boolean IsOnlyStateProvince
		{
			get { return GetProperty(IsOnlyStateProvinceProperty); }
			private set { LoadProperty(IsOnlyStateProvinceProperty, value); }
		}

		#endregion

		#endregion

		#region "Constructors"

		internal StateProvinceInfo(Int32 id, String stateProvinceCode, String countryRegionCode, String name, Boolean isOnlyStateProvince)
		{
			this.Id = id;
			this.StateProvinceCode = stateProvinceCode;
			this.CountryRegionCode = countryRegionCode;
			this.Name = name;
			this.IsOnlyStateProvince = isOnlyStateProvince;
		}

		#endregion
	}
}
